import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';

import 'package:flutterpicgo/views/home.dart';
import 'package:flutterpicgo/views/404.dart';

var appHandler = new Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) {
    String indexStr = params['index']?.first;
    int index = 0;
    try {
      index = int.parse(indexStr);
    } catch (e) {}
    return AppPage(selectedIndex: index);
  },
);

// 404页面
var notfoundHandler = new Handler(
  handlerFunc: (BuildContext context, Map<String, List<String>> params) =>
      PageNotFound(),
);